import 'package:flutter/material.dart';
import 'package:uiview/utils/generateSetter.dart';

const meta = {
  "props": {
    "autofocus": {
      "describe": "自动聚焦",
      "setter": "BooleanSetter",
      "defaultValue": true,
      "value": true,
    },
    "autofocus2": {
      "describe": "自动聚焦3",
      "setter": "BooleanSetter",
      "defaultValue": true,
      "value": true,
    }
  }
};

class ElevatedButtonDemo extends StatelessWidget {
  const ElevatedButtonDemo({ Key? key }) : super(key: key);
  @override
  Widget build(BuildContext context){
    return Column(
      children: [
        Center(
          child: ElevatedButton(
            child: const Text("按钮"),
            autofocus: true,
            onPressed: () {

            },
          ),
        ),
        ...(meta["props"] as Map).keys.map((key) => generateSetter(meta["props"]![key] as Map)),
      ],
    );
  }
}